#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}

"${DIRECTORY}/purge-installed" "$(dirname "$0")" || error "Failed to purge-installed!"

rm -rf $HOME/Temps-linux-armv7l || sudo rm -rf $HOME/Temps-linux-armv7l || error 'Failed to remove "Temps-linux-armv7l" folder!'
sudo rm -f /usr/local/bin/temps || error 'Failed to remove /usr/local/bin/temps!'
sudo rm -f $HOME/.local/share/applications/Temps.desktop || 'Failed to remove menu shortcut!'
